package com.sservice.service.service;

import com.sservice.urp.entity.Permission;
import com.sservice.urp.vo.PermissionVo;

import java.util.List;

public interface IPermissionService {
    /**
     * 分页查询:关键字，手机号、字段升降序、每页显示大小，某一页
     * 默认进行每页15个显示
     *
     * @param user
     * @return
     */
    List<Permission> queryByPage(PermissionVo user);

    int queryCount(PermissionVo user);

    int deleteByPrimaryKey(Integer id);

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Permission record);

    List<Permission> getPermissionByUserID(int userid);

    /***
     * c查看看角色
     * @param roleId
     * @return
     */
    List<Permission> getPermissionByRoleId(int roleId);

    /**
     * 判断用户是否拥有某项权限
     * @param userId  用户ID
     * @param permissionId  权限ID
     * @param list 权限集合
     * @return
     */
    boolean hasPermission(int userId, int permissionId, List<Permission> list);

}
